home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / mswin.vim < prev    next >
Encoding:
Text File  |  2001-08-23  |  2.0 KB  |  88 lines

  1. " Set options and add mapping such that Vim behaves a lot like MS-Windows
  2. "
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last change:    2001 Aug 23
  5.  
  6. " set the 'cpoptions' to its Vim default
  7. if 1    " only do this when compiled with expression evaluation
  8.   let s:save_cpo = &cpoptions
  9. endif
  10. set cpo&vim
  11.  
  12. " set 'selection', 'selectmode', 'mousemodel' and 'keymodel' for MS-Windows
  13. behave mswin
  14.  
  15. " backspace and cursor keys wrap to previous/next line
  16. set backspace=2 whichwrap+=<,>,[,]
  17.  
  18. " backspace in Visual mode deletes selection
  19. vnoremap <BS> d
  20.  
  21. " CTRL-X and SHIFT-Del are Cut
  22. vnoremap <C-X> "+x
  23. vnoremap <S-Del> "+x
  24.  
  25. " CTRL-C and CTRL-Insert are Copy
  26. vnoremap <C-C> "+y
  27. vnoremap <C-Insert> "+y
  28.  
  29. " CTRL-V and SHIFT-Insert are Paste
  30. nnoremap <silent> <SID>Paste "=@+.'xy'<CR>gPFx"_2x
  31. map <C-V>        <SID>Paste
  32. map <S-Insert>        <SID>Paste
  33.  
  34. imap <C-V>        x<Esc><SID>Paste"_s
  35. imap <S-Insert>        x<Esc><SID>Paste"_s
  36.  
  37. cmap <C-V>        <C-R>+
  38. cmap <S-Insert>        <C-R>+
  39.  
  40. vmap <C-V>        "-cx<Esc><SID>Paste"_x
  41. vmap <S-Insert>        "-cx<Esc><SID>Paste"_x
  42.  
  43. " Use CTRL-Q to do what CTRL-V used to do
  44. noremap <C-Q>        <C-V>
  45.  
  46. " For CTRL-V to work autoselect must be off.
  47. " On Unix we have two selections, autoselect can be used.
  48. if !has("unix")
  49.   set guioptions-=a
  50. endif
  51.  
  52. " CTRL-Z is Undo; not in cmdline though
  53. noremap <C-Z> u
  54. inoremap <C-Z> <C-O>u
  55.  
  56. " CTRL-Y is Redo (although not repeat); not in cmdline though
  57. noremap <C-Y> <C-R>
  58. inoremap <C-Y> <C-O><C-R>
  59.  
  60. " Alt-Space is System menu
  61. if has("gui")
  62.   noremap <M-Space> :simalt ~<CR>
  63.   inoremap <M-Space> <C-O>:simalt ~<CR>
  64.   cnoremap <M-Space> <C-C>:simalt ~<CR>
  65. endif
  66.  
  67. " CTRL-A is Select all
  68. noremap <C-A> gggH<C-O>G
  69. inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
  70. cnoremap <C-A> <C-C>gggH<C-O>G
  71.  
  72. " CTRL-Tab is Next window
  73. noremap <C-Tab> <C-W>w
  74. inoremap <C-Tab> <C-O><C-W>w
  75. cnoremap <C-Tab> <C-C><C-W>w
  76.  
  77. " CTRL-F4 is Close window
  78. noremap <C-F4> <C-W>c
  79. inoremap <C-F4> <C-O><C-W>c
  80. cnoremap <C-F4> <C-C><C-W>c
  81.  
  82. " restore 'cpoptions'
  83. set cpo&
  84. if 1
  85.   let &cpoptions = s:save_cpo
  86.   unlet s:save_cpo
  87. endif
  88.